(define "CompleteLineWithPieceTaken" (if (or (= (what at:(handSite (mover))) (id "Square0")) (= (what at:(handSite (mover))) (mover)) ) (add (piece (mover)) (to (last To))) (add (piece (next)) (to (last To))) ) (remove (handSite (mover))) ) (define "TakeAPieceInOuterSites" (move Select (from (sites Outer)) (then (and (fromTo (from (last To)) (to (handSite (mover))) ) (moveAgain) ) ) ) ) (define "LastRow" (sites Row (row of:(last To))) ) (define "LastColumn" (sites Column (column of:(last To))) ) (define "From" (from (difference (intersection (sites #1) #2 ) (sites {(last To)}) ) ) ) (define "Push" (move Select #1 (then (and { (push (from (last To)) #2) "CompleteLineWithPieceTaken" }) ) ) ) //------------------------------------------------------------------------------ (game "Pushing Me XO" (players 2) (equipment { (board (square 5)) (piece "Disc" P1) (piece "Cross" P2) (piece "Square" Neutral) (hand Each) }) (rules (start (place "Square0" (sites Board))) (play (if "SameTurn" (or { ("Push" ("From" Left "LastRow") E) ("Push" ("From" Right "LastRow") W) ("Push" ("From" Bottom "LastColumn") N) ("Push" ("From" Top "LastColumn") S) }) "TakeAPieceInOuterSites" ) ) (end { (if (is Line 5 throughAny:(sites LastTo) what:(next)) (result Next Win)) (if (is Line 5 throughAny:(sites LastTo) what:(mover)) (result Mover Win)) }) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Pushing Me XO, a strategic game for brain training while playing to find the ways to connect and creates the line with cubes to win the game in horizontally, vertically or diagonal.") (rules "At the first round of the game, players can only pick a blank face cube. Next round players can play the same cube at the previously. A player cannot return a cube that he/she has played to place on where he/she took it from. A player who creates the line of opponent’s symbol is the person who loses the game, even if he/she has created a line of his/her own symbol at the same time.") (source "Amazon") (id "547") (version "1.3.12") (classification "board/space/line") (publisher "BSiri Games & Puzzles") (credit "Eric Piette") } ) (graphics { (player Colour P1 (colour Gold)) (player Colour P2 (colour Dark)) (player Colour Neutral (colour Gold)) (board Colour Phase0 (colour Gold)) (board Colour InnerEdges (colour Gold)) (board Colour OuterEdges (colour Dark)) (board StyleThickness OuterEdges 0.0) }) (ai "Pushing Me XO_ai" ) )